// From: http://www.flexforum.org/index.php?showtopic=11

package org.swxformat
{
	import mx.core.IUIComponent;
	import mx.containers.Panel;

	public class PanelWithButtons extends Panel
	{
		
		[Bindable]
		private var titleButtons:panelButtons; 
			    
		override protected function createChildren():void
		{
			super.createChildren();
			titleButtons = new panelButtons();
			titleBar.addChild(titleButtons);		
		}
			
		override protected function layoutChrome(unscaledWidth:Number, unscaledHeight:Number):void
		{	  
			super.layoutChrome(unscaledWidth, unscaledHeight);
					
			titleButtons.width = unscaledWidth / 2;
			titleButtons.height = titleButtons.measuredHeight;
			titleButtons.move(statusTextField.x - 122, 4);
		} 
	}	
}